'use strict'

class alltemplate {
    constructor() {
        this.param = '/'
    }
    //创建资源
    async get(c) {
        try {
            let sqltext1 = `select * from template`
            var r1 = await c.service.psql.query(sqltext1);
            if (r1.rowCount == 0) {
                c.send('have no template');
                console.log('have no template');
                return
            }
            c.send(r1.rows);
            return
        }
        catch (err) {
            console.log(err)
            return c.status(500).send('error');

        }
    }
}

module.exports = alltemplate